﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Wintellect.LiveFx.Cloudboard
{
  /// <summary>
  /// Interaction logic for CloudLogin.xaml
  /// </summary>
  public partial class CloudLogin : Window
  {
    private System.Net.NetworkCredential liveId;

    public CloudLogin()
    {
      InitializeComponent();
    }

    public System.Net.NetworkCredential LiveID
    {
      get
      {
        return this.liveId;
      }
    }

    private void ok_Click(object sender, RoutedEventArgs e)
    {
      this.DialogResult = true;
      this.liveId = new System.Net.NetworkCredential(this.liveIdAddress.Text, this.liveIdPassword.Password, null);

      if (this.save.IsChecked ?? false)
      {
        Configuration.Instance.SetLiveCredentials(liveId);
      }
      this.Close();
    }

    private void cancel_Click(object sender, RoutedEventArgs e)
    {
      this.DialogResult = false;
      this.Close();
    }
  }
}
